
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<title><?php bloginfo('name'); ?> <?php if ( is_single() ) { ?> <?php } ?> <?php wp_title(); ?></title>
<?php
	/* We add some JavaScript to pages with the comment form
	 * to support sites with threaded comments (when in use).
	 */
	if ( is_singular() && get_option( 'thread_comments' ) )
		wp_enqueue_script( 'comment-reply' );

	/* Always have wp_head() just before the closing </head>
	 * tag of your theme, or you will break many plugins, which
	 * generally use this hook to add elements to <head> such
	 * as styles, scripts, and meta tags.
	 */
	wp_head();
?>

<style type="text/css" media="screen" >
	@import url("<?php bloginfo("stylesheet_url"); ?>");
</style>
<script type="text/javascript" src="<?php echo get_option('home'); ?>/wp-includes/js/jquery/jquery.js"></script>
<script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/js/carousel/stepcarousel.js"></script>
<script type="text/javascript">

stepcarousel.setup({
	galleryid: 'board_carusel', //id of carousel DIV
	beltclass: 'belt', //class of inner "belt" DIV containing all the panel DIVs
	panelclass: 'board_item', //class of panel DIVs each holding content
	autostep: {enable:true, moveby:1, pause:<?php echo FEATURED_SPEED*1000; ?>},
	panelbehavior: {speed:500, wraparound:false, persist:false},
	defaultbuttons: {enable: false, moveby: 1, leftnav: ['http://i34.tinypic.com/317e0s5.gif', -5, 80], rightnav: ['http://i38.tinypic.com/33o7di8.gif', -20, 80]},
	statusvars: ['statusA', 'statusB', 'statusC'], //register 3 variables that contain current panel (start), current panel (last), and total panels
	contenttype: ['inline'] //content setting ['inline'] or ['external', 'path_to_external_file']
})
function setVisibility(id, visibility) {
document.getElementById(id).style.display = visibility;
}
</script>
<script type="text/javascript">
function check_login()
{
	alert ('You must login first');	
}
/***********************************************
* Tab Content script-  Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

//Set tab to intially be selected when page loads:
//[which tab (1=first tab), ID of tab content to display]:
var initialtab=[1, "sc1"]

////////Stop editting////////////////

function cascadedstyle(el, cssproperty, csspropertyNS){
if (el.currentStyle)
return el.currentStyle[cssproperty]
else if (window.getComputedStyle){
var elstyle=window.getComputedStyle(el, "")
return elstyle.getPropertyValue(csspropertyNS)
}
}

var previoustab=""

function expandcontent(cid, aobject){
if (document.getElementById){
highlighttab(aobject)
detectSourceindex(aobject)
if (previoustab!="")
document.getElementById(previoustab).style.display="none"
document.getElementById(cid).style.display="block"
previoustab=cid
if (aobject.blur)
aobject.blur()
return false
}
else
return true
}

function highlighttab(aobject){
if (typeof tabobjlinks=="undefined")
collecttablinks()
for (i=0; i<tabobjlinks.length; i++)
tabobjlinks[i].style.backgroundColor=initTabcolor
var themecolor=aobject.getAttribute("theme")? aobject.getAttribute("theme") : initTabpostcolor
aobject.style.backgroundColor=document.getElementById("tabcontentcontainer").style.backgroundColor=themecolor
}

function collecttablinks(){
var tabobj=document.getElementById("tablist")
tabobjlinks=tabobj.getElementsByTagName("A")
}

function detectSourceindex(aobject){
for (i=0; i<tabobjlinks.length; i++){
if (aobject==tabobjlinks[i]){
tabsourceindex=i //source index of tab bar relative to other tabs
break
}
}
}

function do_onload(){
var cookiename=(typeof persisttype!="undefined" && persisttype=="sitewide")? "tabcontent" : window.location.pathname
var cookiecheck=window.get_cookie && get_cookie(cookiename).indexOf("|")!=-1
collecttablinks()
initTabcolor=cascadedstyle(tabobjlinks[1], "backgroundColor", "background-color")
initTabpostcolor=cascadedstyle(tabobjlinks[0], "backgroundColor", "background-color")
if (typeof enablepersistence!="undefined" && enablepersistence && cookiecheck){
var cookieparse=get_cookie(cookiename).split("|")
var whichtab=cookieparse[0]
var tabcontentid=cookieparse[1]
expandcontent(tabcontentid, tabobjlinks[whichtab])
}
else
expandcontent(initialtab[1], tabobjlinks[initialtab[0]-1])
}

if (window.addEventListener)
window.addEventListener("load", do_onload, false)
else if (window.attachEvent)
window.attachEvent("onload", do_onload)
else if (document.getElementById)
window.onload=do_onload
</script>
</head>

<body>
<div id="header-wrapper">
	<div id="header">
    	<div class="header-logo">
        	<a href="<?php bloginfo('url'); ?>"><h1>Question Mark</h1></a>
        </div>
        <div class="header-title">
        	<h3>An question/answers system powered<br /> 100% by WordPress.</h3>
        </div>
        
        <div class="userpanel">
        		<?php 	
				if($user_ID == 0)
					$user_ID = $_SESSION['user_id_yer'];				
				if($user_ID > 0) 				
				{	
					$profileuser = get_user_to_edit($user_ID);
				?>
                <div class="user-img">
                <?php 				
				$user_avata = get_user_meta( $user_ID,'avatar',true );				
				?>
        		<img src="wp-content/uploads/<?php echo $user_avata; ?>" width="58px" height="59" />
            	</div>
                <div class="user-title">                
				<h5>
				<?=$profileuser->first_name.' '.$profileuser->last_name?>
				</h5>
                <br /><br />
				<a href="<?php bloginfo('url'); ?><?php if($user_ID > 0) echo '/?action=profile';?>">Profile</a> <font style="float:right; color:#5f83a1;">|</font> <a href="<?php bloginfo('url'); ?>/?action=ulogout">Log Out</a>	
                </div>		        
				<?php
				} 
				?>   
        </div>
        
        <div style="clear:both;"></div>
    </div>
    <div class="menu-wrapper">
    	<div class="menu">
        	<p class="topics-title">TRENDING TOPICS:</p>
        	<div class="topics">
        	        <?php $query = "SELECT  t.term_id,t.name
						FROM  wp_terms t JOIN wp_term_taxonomy tt ON t.term_id=tt.term_id
						WHERE tt.taxonomy = 'category' AND t.term_id >1 and parent=0  "; 
        	        $results = $wpdb ->get_results($query);
        	        ?>   
			<ul>
				<?php $j=0; foreach ($results as $c){ $j++?>

				<li><a href="<?php bloginfo('url');?>/?cat=<?php echo $c->term_id ;?>" ><?php echo $c->name;?></a></li>

				<?php if($j==4){break;} };?>	
			</ul>
            </div>
            
            <div class="all">
            	<ul>
                	<li><a href="#" onclick="setVisibility('trough-drawer-box', 'inline');" >See all &raquo;</a></li>
                	
                	<div id="trough-drawer-box" style="display:none" >
		<div id="trough-drawer">			
			
			<div class="bd">
				<div id="trough-bd-bg">
					<ul>
					<?php $j=0; foreach ($results as $c){ $j++?>
					<?php if($j==1){ echo "<ul>";} ?>
					<?php if($j==6){ echo "</ul><ul>";} ?>
					<?php if($j==11){ echo "</ul><ul>";} ?>
					<?php if($j==16){ echo "</ul><ul>";} ?>
					<?php if($j==21){ echo "</ul><ul>";} ?>
					<?php if($j==26){ echo "</ul><ul>";} ?>
					<?php if($j==31){ echo "</ul><ul>";} ?>
					<?php if($j==36){ echo "</ul><ul>";} ?>
					<?php if($j==41){ echo "</ul><ul>";} ?>
					<?php if($j==46){ echo "</ul><ul>";} ?>
					<?php if($j==51){ echo "</ul><ul>";} ?>
					<?php if($j==56){ echo "</ul><ul>";} ?>
					<?php if($j==61){ echo "</ul><ul>";} ?>
					<?php if($j==66){ echo "</ul><ul>";} ?>
					<?php if($j==71){ echo "</ul><ul>";} ?>
					<?php if($j==76){ echo "</ul><ul>";} ?>
					<?php if($j==81){ echo "</ul><ul>";} ?>
					<?php if($j==86){ echo "</ul><ul>";} ?>
					
				<li onclick="setVisibility('trough-drawer-box', 'none');"><a href="<?php bloginfo('url');?>/?cat=<?php echo $c->term_id ;?>" ><?php echo $c->name;?></a></li>

				<?php  };?>					
						
					</ul>				
					
				</div>
			</div>
			
		</div>
	</div>
                </ul>
                
            </div>
            
            <div class="menu-right">
            	<ul>
            		<?php $page = get_page_by_title('About Us')?>
                	<li><a href="<?php echo $page->guid;?>">About Us</a></li>
                	<?php $page = get_page_by_title('Contact')?>
                    <li><a href="<?php echo $page->guid;?>">Contact</a></li>
                    <?php $page = get_page_by_title('Friends')?>
                    <li><a href="<?php echo $page->guid;?>">Friends</a></li>
                    <?php $page = get_page_by_title('Other Pages')?>
                    <li><a href="<?php echo $page->guid;?>">Other Pages</a></li>
                </ul>
            </div>
    	</div>
    </div>
</div>